package com.yang.controller;


import com.yang.entity.Result;
import com.yang.interceptors.LogExecutionTime;
import com.yang.service.Impl.SparkManager;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SparkAIController {

    @Resource
    private SparkManager sparkManager;

    /**
     * spark ai接口
     * @param userInput 用户输入
     * @return 返回结果
     */
    @PostMapping("/sparkAi")
    @LogExecutionTime
    public Result<String> sparkAi(String userInput) {
        System.out.println(userInput);
        String result = sparkManager.sendMesToAIUseXingHuo(userInput);
        return Result.success(result);
    }
}
